[test] Bound the level 0 compaction wait in PrimaryKeyFileStoreTableITCase - #8940
Merged
JingsongLi merged 1 commit intoJul 30, 2026
Merged
Conversation
…TCase Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
PrimaryKeyFileStoreTableITCasecan hang until the 120-minute cap of the "UTCase and ITCase Flink 2.x on JDK 11" job. Since GitHub reports a job timeout asCANCELLEDrather than a failure, and a killed job leaves behind neither a surefire report nor artifacts, this reads as if someone had cancelled the run. It happened twice on clean master in the last two days, in https://github.com/apache/paimon/actions/runs/30420293991 and https://github.com/apache/paimon/actions/runs/30327861765, and once on the unrelated PR #8923, in https://github.com/apache/paimon/actions/runs/30515132005. In each case this class was the only one that loggedRunning ...and never reported completion, against a normal runtime of about 537 s for its 30 tests. Re-running that same job on the unchanged #8923 commit passed, which is what identifies this as a flake in the test rather than a regression from the code under review.The unbounded wait lives in
checkBatchResult. #7036 added awhile (true)loop that waits untilT$filesreports no level 0 files, for tables whereneedLookup()holds, that is a lookup changelog producer or deletion vectors. If compaction never completes, the loop spins forever: intestStandAloneLookupJobRandomthe table iswrite-onlyand compaction is performed by a separateCompactActionjob, so a dead compactor makes the condition unsatisfiable.@Timeout(180)does not rescue the test, because JUnit 5.8.1 in SAME_THREAD mode delivers a singleThread.interrupt(), and the loop spends nearly all of its time inside a Flink job where that interrupt is lost. #4634 had already introduced thecollect(result, timeout)watchdog helper for exactly this class of problem, and the next statement in the same method uses it, but the loop added later callsTableResult.collect()directly and bypasses it.This change bounds the wait by
TIMEOUTseconds, routes the query through the existing watchdog helper, and reports how many level 0 files were still present when the deadline expired. A stalled compaction now fails in about three minutes with a message that separates "compaction is dead" from "compaction is slow", instead of consuming the entire CI job. The deadline equals the value these tests are already annotated with, so no test becomes stricter than it was meant to be.Tests
Ran the eight
*Randomtests that reachcheckBatchResultunder-Pflink2on JDK 11:Tests run: 8, Failures: 0, Errors: 0in 149 s.Negative check, to confirm the deadline actually fires instead of being dead code: with the loop condition temporarily made unsatisfiable and the deadline shortened, the test failed after 46 s with
java.util.concurrent.TimeoutExceptionreporting 16 remaining level 0 files, rather than hanging. That temporary modification is not part of this PR.